package student

import "fmt"

type Student struct {
	ID    int
	Name  string
	Age   int
	Sex   string
	Grade int
}

func (student Student) StudentsPrinter() {
	fmt.Println("学生姓名: %s", student.Name)
	fmt.Println("学生年龄: %d", student.Age)
	fmt.Println("学生性别: %s", student.Sex)
	fmt.Println("学生年级: %d", student.Grade)
}

func GetStudentInformation() []Student {
	students := []Student{
		{
			ID:    1,
			Name:  "张三",
			Age:   18,
			Sex:   "男",
			Grade: 1,
		},
		{
			ID:    2,
			Name:  "李四",
			Age:   19,
			Sex:   "男",
			Grade: 2,
		},
		{
			ID:    3,
			Name:  "王五",
			Age:   20,
			Sex:   "女",
			Grade: 3,
		},
	}

	for _, student := range students {
		fmt.Println("学生ID: %d, 姓名: %s, 年龄：%d, 性别：%s, 年级:%d\n", student.ID, student.Name, student.Age, student.Sex, student.Grade)
	}

	return students
}

func InsertStudentInformation(student Student) {
	fmt.Println(student)
}
